package commands;

import java.util.EnumSet;

public enum Shortcuts {

	A("a"), // add
	RM("rm"), // remove
	L("l"), // list
	C("c"), // complete
	E("e"), // edit
	U("u"), // undo
	RD("rd"), // redo
	H("h"), // help
	V("v"), // view
	Q("q"), // quit/exit
	S("s");

	private String value_;

	Shortcuts(String value) {
		this.value_ = value;
	}

	public String toString() {
		return value_;
	}

	public static AvailableCommands getByValue(String value) {
		AvailableCommands returnValue = null;
		for (final AvailableCommands element : EnumSet
				.allOf(AvailableCommands.class)) {
			if (element.toString().equals(value)) {
				returnValue = element;
			}
		}
		return returnValue;
	}
}
